﻿using eCommerce.core;
using eCommerce.core.Helpers;

namespace eCommerce.db.SQLDataAccess
{
    public class DbConnection
    {
        public enum ConnectionName { Main = 1, OldSystem = 2 }

        public static void SetConnection(ConnectionName connectionName)
        {
            switch (connectionName)
            {
                case ConnectionName.Main:
                    DbCommon.ConnectionString = Utils.GetSetting(Constant.MainConnection, SettingType.ConnectionString).ToString();
                    break;
                case ConnectionName.OldSystem:
                    DbCommon.ConnectionString = Utils.GetSetting(Constant.MainConnection_OldSystem, SettingType.ConnectionString).ToString();
                    break;                
            }
        }
    }
}
